package com.example.film.mapper;

import com.example.film.entity.CinemaWeekSell;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CinemaWeekSellMapper {

    //查找影院每周票房信息
    @Select("select cinemaName,theaterName,session,people,box_office,week from cinemaweeksell")
    List<CinemaWeekSell> findCinemaWeekSell();

    //分页查询影院每周票房信息
    @Select("select cinemaName,theaterName,session,people,box_office,week from cinemaweeksell LIMIT #{pageSize} OFFSET #{startIndex}")
    List<CinemaWeekSell> findCinemaWeekSellInfo(@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);

    //根据周数分页显示影院每周票房信息
    @Select("select cinemaName,theaterName,session,people,box_office,week from cinemaweeksell where week=#{week} LIMIT #{pageSize} OFFSET #{startIndex}")
    List<CinemaWeekSell> findCinemaWeekSellByWeek(@Param("week") Integer week,@Param("startIndex") Integer startIndex, @Param("pageSize") Integer pageSize);
}
